/**
 * Urban Parks 
 *
 * Team M&M'S 
 * Michael Pogson
 * Michael Satran Jr.
 * Stehpen Hunter
 * 
 * Date: ${date}
 */

package model;

/**
 * 
 * @author Stephen Hunter
 * @version Winter 2012
 */
public class User {

	/**
	 * The first name of the user.
	 */
	private String my_firstName;
	
	/**
	 * The last name of the user.
	 */
	private String my_lastName;
	
	/**
	 * The phone number of the user.
	 */
	private String my_phoneNumber;
	
	/**
	 * The e-mail address of the user.
	 */
	private String my_email;
	
	/*
	 * @post my_firstName == John
	 * @post my_lastName == Doe
	 * @post my_phoneNumber == null
	 * @post my_email == null
	 */
	/**
	 * Constructor creates a User object with default values.
	 */
	public User() {
		my_firstName = "John";
		my_lastName = "Doe";
		my_phoneNumber = null;
		my_email = null;
	}
	
	/*
	 * @pre the_firstName != null
	 * @pre the_lastName != null
	 * @pre the_phoneNumber != null
	 * @pre the_email != null
	 * 
	 * @post my_firstName == the_firstName
	 * @post my_lastName == the_lastName
	 * @post my_phoneNumber == the_phoneNumber
	 * @post my_email == the-email
	 */
	/**
	 * Constructor creates a User object with the given values.
	 * 
	 * @param the_firstName The name to set as the first name for the user
	 * @param the_lastName The name to set as the last name for the user
	 * @param the_phoneNumber The String to set as the phone number for the user
	 * @param the_email The email to set as the email for the user
	 */
	public User(final String the_firstName, final String the_lastName,
				final String the_phoneNumber, final String the_email) 
						throws IllegalArgumentException {
		if (the_firstName == null) {
			throw new IllegalArgumentException("First name is null.");
		} else {
			my_firstName = the_firstName;
		}
		
		if (the_lastName == null) {
			throw new IllegalArgumentException("Last name is null.");
		} else {
			my_lastName = the_lastName;
		}
		
		if (the_phoneNumber == null) {
			throw new IllegalArgumentException("Phone number is null.");
		} else {
			my_phoneNumber = the_phoneNumber;
		}
		
		if (the_email == null) {
			throw new IllegalArgumentException("Email is null.");
		} else {
			my_email = the_email;
		}
	}
	
	/*
	 * @pre the_firstName != null
	 * 
	 * @post my_firstName == the_firstName
	 */
	/**
	 * Sets the user's first name to the given first name
	 * 
	 * @param the_firstName The name to set as the user's first name
	 * @throws IllegalArgumentException if the parameter is null
	 */
	public void setFirstName(final String the_firstName) throws IllegalArgumentException {
		if (the_firstName == null) {
			throw new IllegalArgumentException("First name is null.");
		} else {
			my_firstName = the_firstName;
		}
	}
	
	/*
	 * @post Returns the first name of the user
	 */
	/**
	 * Returns the first name of the user.
	 * 
	 * @return the first name of the user.
	 */
	public String getFirstName() {
		return my_firstName;
	}
	
	/*
	 * @pre the_lastName != null
	 * 
	 * @post my_lastName == the_lastName
	 */
	/**
	 * Sets the last name of the user to the given name
	 * 
	 * @param the_lastName The name to set as the user's last name
	 * @throws IllegalArgumentExcpetion if the parameter is null
	 */
	public void setLastName(final String the_lastName) throws IllegalArgumentException {
		if (the_lastName == null) {
			throw new IllegalArgumentException("Last name is null.");
		} else {
			my_lastName = the_lastName;
		}
	}
	
	/*
	 * @post returns the last name of the user
	 */
	/**
	 * Returns the last name of the user.
	 * 
	 * @return The last name of the user
	 */
	public String getLastName() {
		return my_lastName;
	}
	
	/*
	 * @pre the_phoneNumber != null
	 * 
	 * @post my_phoneNumber == the_phoneNumber
	 */
	/**
	 * Sets the user's phone number to the given phone number.
	 * 
	 * @param the_phoneNumber The String to set as the user's phone number
	 * @throws IllegalArgumentException is the parameter is null
	 */
	public void setPhoneNumber(final String the_phoneNumber) throws IllegalArgumentException {
		if (the_phoneNumber == null) {
			throw new IllegalArgumentException("Phone number is null.");
		} else {
			my_phoneNumber = the_phoneNumber;
		}
	}
	
	/*
	 * @post Returns the user's phone number
	 */
	/**
	 * Returns the user's phone number.
	 * 
	 * @return The user's phone number
	 */
	public String getPhoneNumber() {
		return my_phoneNumber;
	}
	
	/*
	 * @pre the_email != null
	 * 
	 * @post my_email == the_email
	 */
	/**
	 * Sets the user's email to the given email
	 * 
	 * @param the_email The email to set as the user's email
	 * @throws IllegalArgumentException is the parameter is null
	 */
	public void setEmail(final String the_email) throws IllegalArgumentException {
		if (the_email == null) {
			throw new IllegalArgumentException("Email is null.");
		} else {
			my_email = the_email;
		}
	}
	
	/*
	 * @post Returns the user's email
	 */
	/**
	 * Returns the user's email
	 * 
	 * @return The user's email
	 */
	public String getEmail() {
		return my_email;
	}
}
